package com.sh.personnel.mapper;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 林思浩
 * @date 2020/02/26 22:19
 */
@Repository
public interface IPermissionMapper {

    //根据用户id获取资源集合
    @Select("SELECT t1.permission FROM tb_menu t1, tb_role_menu t2, tb_user_role t3" +
            " WHERE t3.userid = #{id}" +
            " AND t1.id = t2.menuid" +
            " AND t2.roleid = t3.roleid")
    List<String> findPermissionByUserId(String id);

}
